<?xml version="1.0" encoding="utf-8"?>

<div xmlns="http://www.w3.org/1999/xhtml" xid="window" class="window" component="$UI/system/components/justep/window/window">  
  <div component="$UI/system/components/justep/model/model" xid="model" style="top:235px;left:255px;height:auto;"
    onParamsReceive="modelParamsReceive"> 
    <div component="$UI/system/components/justep/data/data" autoLoad="true"
      xid="menuData" confirmRefresh="false" idColumn="id" confirmDelete="false"> 
      <column name="id" type="String" xid="xid1"/>  
      <column label="菜单名称" name="name" type="String" xid="xid2"/>  
      <column name="key" type="String" xid="xid3"/>  
      <column name="type" type="String" xid="xid4"/>  
      <column name="url" type="String" xid="xid5"/>  
      <column name="appId" type="String" xid="xid22"/>  
      <column name="pagePath" type="String" xid="xid23"/> 
    </div>  
    <div component="$UI/system/components/justep/data/data" autoLoad="false"
      xid="subMenuData" idColumn="id" confirmRefresh="false" confirmDelete="false"> 
      <column name="id" type="String" xid="xid6"/>  
      <column name="parent" type="String" xid="xid7"/>  
      <column name="name" type="String" xid="xid8"/>  
      <column name="key" type="String" xid="xid9"/>  
      <column name="type" type="String" xid="xid10"/>  
      <column name="url" type="String" xid="xid11"/>  
      <column name="appId" type="String" xid="xid15"/>  
      <column name="pagePath" type="String" xid="xid16"/> 
    </div>  
    <div component="$UI/system/components/justep/data/data" autoLoad="true"
      xid="typeData" confirmRefresh="false" confirmDelete="false" idColumn="id"> 
      <column name="id" type="String" xid="xid12"/>  
      <column name="type" type="String" xid="xid13"/>  
      <column name="label" type="String" xid="xid14"/>  
      <data xid="default1">[{"type":"view","label":"网页类型"},{"type":"click","label":"点击类型"},{"type":"miniprogram","label":"小程序类型"}]</data> 
    </div> 
  </div>  
  <div component="$UI/system/components/justep/panel/panel" class="x-panel x-full"
    xid="panel2"> 
    <div class="x-panel-content" xid="content3"> 
      <div component="$UI/system/components/justep/row/row" class="x-row" xid="row1"
        style="height:100%;padding: 24px 0"> 
        <div class="x-col x-col-fixed left-menu" xid="col1"> 
          <a component="$UI/system/components/justep/button/button" class="btn btn-link"
            label="通用菜单" xid="button1" bind-css="{&quot;active&quot;:$model.btnIndex.get()==0}"
            onClick="toggleBtnClick" target="content4"> 
            <i xid="i1"/>  
            <span xid="span1">通用菜单</span> 
          </a> 
        </div>  
        <div class="x-col" xid="col2" style="position: relative;"> 
          <div component="$UI/system/components/justep/contents/contents" class="x-contents"
            active="0" xid="contents1" style="padding: 0 24px;"> 
            <div class="x-contents-content" xid="content4"> 
              <div xid="div2" class="menu-item-wrap"> 
                <a component="$UI/system/components/justep/button/button"
                  class="btn btn-link menu-item-btn" label="当前菜单" xid="nowMenuBtn"
                  onClick="nowMenuBtnClick"> 
                  <i xid="i3"/>  
                  <span xid="span3">当前菜单</span> 
                </a>  
                <a component="$UI/system/components/justep/button/button"
                  class="btn x-blue pull-right" label="菜单发布" xid="releaseBtn" style="margin: 12px 12px 0 0" onClick="releaseBtnClick" bind-enable="$model.menuData.count() &gt;0"> 
                  <i xid="i2"/>  
                  <span xid="span2">菜单发布</span> 
                </a> 
              </div>  
              <div xid="div4" class="menu-set-wrap"> 
                <div component="$UI/system/components/justep/row/row" class="x-row"
                  xid="row2" style="width:100%;"> 
                  <div class="x-col x-col-fixed br" xid="col4" style="width:380px;margin-right: 32px;height:auto;"> 
                    <div xid="div1" class="menu-set-tit"> 
                      <span xid="span4"><![CDATA[菜单设置]]></span>  
                      <a component="$UI/system/components/justep/button/button"
                        class="btn btn-link btn-only-icon" label="button" xid="addBtn"
                        icon="icon-android-add" onClick="addBtnClick"> 
                        <i xid="i4" class="icon-android-add"/>  
                        <span xid="span6"/> 
                      </a> 
                    </div>  
                    <p xid="p1" class="tips" bind-visible=" $model.menuData.count() ==0"><![CDATA[尚未设置菜单]]></p>  
                    <div component="$UI/system/components/justep/list/list"
                      class="x-list menu-list" xid="list1" data="menuData" dataItemAlias="a"> 
                      <ul class="x-list-template" xid="listTemplateUl1"> 
                        <li xid="li1" bind-click="eventStop"> 
                          <div component="$UI/system/components/justep/row/row"
                            class="x-row" xid="row3" style="padding:6px 0;" bind-click="menuItemClick"> 
                            <div class="x-col x-col-center" xid="col3"> 
                              <span xid="span9" bind-text="val(&quot;name&quot;)" style="margin-left: 12px;" bind-click="eventStop"/> 
                            </div>  
                            <div class="x-col x-col-fixed x-col-center js-show"
                              xid="col6" style="width:auto;display:none"> 
                              <a component="$UI/system/components/justep/button/button"
                                class="btn btn-link btn-only-icon" label="button"
                                xid="button4" icon="dataControl dataControl-plusl"
                                title="添加" onClick="addSubMenuClick"> 
                                <i xid="i7" class="dataControl dataControl-plusl"/>  
                                <span xid="span10"/> 
                              </a>  
                              <a component="$UI/system/components/justep/button/button"
                                class="btn btn-link btn-only-icon" label="button"
                                xid="button5" icon="dataControl dataControl-pencill"
                                title="编辑" onClick="editeMenuClick"> 
                                <i xid="i8" class="dataControl dataControl-pencill"/>  
                                <span xid="span11"/> 
                              </a>  
                              <a component="$UI/system/components/justep/button/button"
                                class="btn btn-link btn-only-icon" label="button"
                                xid="button6" icon="icon-ios7-trash-outline" title="删除"
                                onClick="delMenuClick"> 
                                <i xid="i9" class="icon-ios7-trash-outline"/>  
                                <span xid="span12"/> 
                              </a> 
                            </div> 
                          </div>  
                          <div component="$UI/system/components/justep/list/list"
                            class="x-list" xid="list2" data="$model.subMenuData" filter="$row.val(&quot;parent&quot;) == val(&quot;id&quot;)"> 
                            <ul class="x-list-template" xid="listTemplateUl2"> 
                              <li xid="li2" bind-click="eventStop"> 
                                <div component="$UI/system/components/justep/row/row"
                                  class="x-row" xid="row4" style="padding:6px 0;"
                                  bind-click="subMenuItemClick"> 
                                  <div class="x-col x-col-center" xid="col8"> 
                                    <span xid="span13" bind-text="val(&quot;name&quot;)"
                                      style="margin-left: 24px;" bind-click="eventStop"/> 
                                  </div>  
                                  <div class="x-col x-col-fixed x-col-center js-show"
                                    xid="col7" style="width:auto;display:none"> 
                                    <a component="$UI/system/components/justep/button/button"
                                      class="btn btn-link btn-only-icon" label="button"
                                      xid="button7" icon="dataControl dataControl-pencill"
                                      title="编辑" onClick="editeSubMenuClick"> 
                                      <i xid="i10" class="dataControl dataControl-pencill"/>  
                                      <span xid="span16"/> 
                                    </a>  
                                    <a component="$UI/system/components/justep/button/button"
                                      class="btn btn-link btn-only-icon" label="button"
                                      xid="button8" icon="icon-ios7-trash-outline"
                                      title="删除" onClick="delSubMenuClick"> 
                                      <i xid="i11" class="icon-ios7-trash-outline"/>  
                                      <span xid="span15"/> 
                                    </a> 
                                  </div> 
                                </div> 
                              </li> 
                            </ul> 
                          </div> 
                        </li> 
                      </ul> 
                    </div> 
                  </div>  
                  <div class="x-col br" xid="col5" style="height:auto"> 
                    <div xid="div3" class="menu-set-tit"> 
                      <span xid="span5"><![CDATA[设置回复]]></span> 
                    </div>  
                    <p xid="p2" class="tips" bind-visible="$model.setKeyShow.get()==0"><![CDATA[你可以先添加并选中一个菜单，然后开始为其设置回复]]></p>  
                    <p xid="p8" class="tips" bind-visible="$model.hasSubMenu.get() &amp;&amp; $model.setKeyShow.get()==1"
                      style="display:none;"><![CDATA[当前菜单已设置二级菜单，请选择二级菜单为其设置回复]]></p>
                    <div xid="subMenuVal" style="padding:12px;font-size: 12px;display:none;"
                      bind-visible="$model.setKeyShow.get()==2"> 
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit2"> 
                        <label class="x-label" xid="label2"><![CDATA[菜单响应类型：]]></label>  
                        <select component="$UI/system/components/justep/select/select"
                          class="form-control x-edit" xid="select1" bind-options="typeData"
                          bind-optionsCaption="请选择菜单响应类型" bind-optionsValue="type"
                          bind-optionsLabel="label" bind-ref="$model.subMenuData.ref(&quot;type&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit1" bind-visible="$model.subMenuData.val(&quot;type&quot;) ==&quot;click&quot;"> 
                        <label class="x-label" xid="label1"><![CDATA[菜单KEY值：]]></label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input2" bind-ref="$model.subMenuData.ref(&quot;key&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit3" bind-visible='$model.subMenuData.val("type")&amp;&amp;$model.subMenuData.val("type") !="click"'> 
                        <label class="x-label" xid="label3"><![CDATA[url:]]></label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input3" bind-ref="$model.subMenuData.ref(&quot;url&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit4" bind-visible="$model.subMenuData.val(&quot;type&quot;) ==&quot;miniprogram&quot;"> 
                        <label class="x-label" xid="label4"><![CDATA[小程序appid]]></label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input4" bind-ref="$model.subMenuData.ref(&quot;appId&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit5" bind-visible="$model.subMenuData.val(&quot;type&quot;) ==&quot;miniprogram&quot;"> 
                        <label class="x-label" xid="label5"><![CDATA[小程序页面路径：]]></label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input5" bind-ref="$model.subMenuData.ref(&quot;pagePath&quot;)"/> 
                      </div> 
                    </div>  
                    <div xid="menuVal" style="padding:12px;font-size: 12px;display:none;"
                      bind-visible="$model.setKeyShow.get()==1 &amp;&amp; $model.hasSubMenu.get()==false"> 
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit8"> 
                        <label class="x-label" xid="label7">菜单响应类型：</label>  
                        <select component="$UI/system/components/justep/select/select"
                          class="form-control x-edit" xid="select2" bind-options="typeData"
                          bind-optionsCaption="请选择菜单响应类型" bind-optionsValue="type"
                          bind-optionsLabel="label" bind-ref="$model.menuData.ref(&quot;type&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit6" bind-visible="$model.menuData.val(&quot;type&quot;) ==&quot;click&quot;"> 
                        <label class="x-label" xid="label6">菜单KEY值：</label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input9" bind-ref="$model.menuData.ref(&quot;key&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit7" bind-visible='$model.menuData.val("type")&amp;&amp;$model.menuData.val("type") !="click"'> 
                        <label class="x-label" xid="label8">url:</label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input8" bind-ref="$model.menuData.ref(&quot;url&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit10" bind-visible="$model.menuData.val(&quot;type&quot;) ==&quot;miniprogram&quot;"> 
                        <label class="x-label" xid="label9">小程序appid</label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input7" bind-ref="$model.menuData.ref(&quot;appId&quot;)"/> 
                      </div>  
                      <div component="$UI/system/components/justep/labelEdit/labelEdit"
                        class="x-label-edit x-label30" xid="labelEdit9" bind-visible="$model.menuData.val(&quot;type&quot;) ==&quot;miniprogram&quot;"> 
                        <label class="x-label" xid="label10">小程序页面路径：</label>  
                        <input component="$UI/system/components/justep/input/input"
                          class="form-control x-edit" xid="input6" bind-ref="$model.menuData.ref(&quot;pagePath&quot;)"/> 
                      </div> 
                    </div> 
                  </div> 
                </div> 
              </div>  
              <div xid="div5" class="menu-tips"> 
                <p xid="p7"><![CDATA[注意事项：]]></p>  
                <p xid="p4"><![CDATA[1、自定义菜单最多包括3个一级菜单，每个一级菜单最多包含5个二级菜单。]]></p>  
                <p xid="p5"><![CDATA[2、一级菜单最多4个汉字，二级菜单最多7个汉字，多出来的部分将会以“...”代替]]></p>  
                <p xid="p6"><![CDATA[3、创建自定义菜单后，菜单的刷新策略是，在用户进入公众号会话页或公众号profile页时，如果发现上一次拉取菜单的请求在5分钟以前，就会拉取一下菜单，如果菜单有更新，就会刷新客户端的菜单。测试时可以尝试取消关注公众账号后再次关注，则可以看到创建后的效果。]]></p> 
              </div> 
            </div> 
          </div> 
        </div> 
      </div> 
    </div> 
  </div>  
  <div xid="popur" class="pop-wrap"> 
    <p xid="p3" style="padding: 16px 16px 8px;margin: 0;color: #999;"><![CDATA[输入名称]]></p>  
    <input component="$UI/system/components/justep/input/input" class="form-control"
      xid="input1" placeHolder="一级菜单不多于5个汉字或16个字母！"/>  
    <div xid="div6" class="pop-btn"> 
      <a component="$UI/system/components/justep/button/button" class="btn btn-cancel"
        label="取消" xid="popCancelBtn" onClick="popCancelBtnClick"> 
        <i xid="i5"/>  
        <span xid="span7">取消</span> 
      </a>  
      <a component="$UI/system/components/justep/button/button" class="btn btn-sure"
        label="确认" xid="popSureBtn" onClick="popSureBtnClick"> 
        <i xid="i6"/>  
        <span xid="span8">确认</span> 
      </a> 
    </div> 
  </div> 
</div>
